M13.7: NFR-16 latency bench + ProxyJump integration harness#14
Merged
Conversation
Lands the verification surface for the M13 chapter: tests/test_proxy_jump.rs (new): - TestServer russh::server fixture that accepts any auth + transparently relays direct-tcpip channels to the requested host:port. - spawn_server() helper binds a loopback port and runs the server in a tokio::spawn'd task that owns both the server and the listener. - two_hop_chain_succeeds: spawns bastion + target, points AnvilSession::connect_via_jump_hosts at the chain, asserts success (NFR-17 host-key verification path runs at every hop). - empty_jump_chain_is_rejected: sanity test for the empty-list guard. - Both tests #[ignore]-gated behind GITWAY_INTEGRATION_TESTS=1 so CI doesn't spin up russh::server instances on every run; opt-in via `GITWAY_INTEGRATION_TESTS=1 cargo test --test test_proxy_jump -- --ignored`. benches/proxy_chain.rs (new): - BenchServer mirrors TestServer for use inside the Criterion harness. - Two Criterion benchmarks: proxy_chain/1_hop_direct_cold and proxy_chain/2_hop_via_bastion_cold. - enforce_nfr16_ratio runs 16 cold-start measurements outside Criterion and asserts 2-hop median <= 2 * 1-hop median on loopback. NFR-16's 1.5-s/hop budget on a 50-ms RTT link is honest only on a real network; the loopback gate enforces the relative shape, with real-RTT validation documented as a manual procedure in the M13 plan. - Bench bodies skip when GITWAY_INTEGRATION_TESTS=1 is unset so cargo bench doesn't accidentally depend on a running russh::server in CI. tests/ssh_config_matrix/11_jump_chain.yaml (new): - Declarative coverage of ProxyJump capture: a chain string survives the resolver as raw text for M13.3's parse_jump_chain to consume. Cargo.toml: registers the new [[bench]] proxy_chain harness. Tests: 185 lib + 1 matrix + 6 integration + 2 ignored proxy_jump + 5 ignored (existing); 0 failures. Plan: M13.7 of let-us-plan-on-bright-cosmos.md.
Linux fmt prefers the single-line form for the shorter expect message; my local Windows fmt had auto-wrapped to two lines (same issue we hit in M12.4). Squashes the lint-job failure on Anvil PR #14.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lands the verification surface for the M13 chapter: a russh::server-driven 2-hop integration test (NFR-17) and the loopback NFR-16 bench gate.
Files added
tests/test_proxy_jump.rs—TestServerrussh::server fixture (accepts any auth, transparently relaysdirect-tcpipchannels). Two tests:two_hop_chain_succeeds— bastion + target on loopback,AnvilSession::connect_via_jump_hostswalks the chain.empty_jump_chain_is_rejected— sanity test for the guard.#[ignore]-gated behindGITWAY_INTEGRATION_TESTS=1; opt-in viacargo test --test test_proxy_jump -- --ignored.benches/proxy_chain.rs— Criterion harness with the same fixture pattern.proxy_chain/1_hop_direct_coldandproxy_chain/2_hop_via_bastion_coldCriterion benchmarks.enforce_nfr16_ratioruns 16 cold-start measurements outside Criterion and asserts2-hop median <= 2 * 1-hop medianon loopback.GITWAY_INTEGRATION_TESTS=1is unset.tests/ssh_config_matrix/11_jump_chain.yaml— declarative coverage that aProxyJumpchain string survives the resolver as raw text forparse_jump_chainto consume.Cargo.toml— registers the new[[bench]] proxy_chainharness.Tests
Test plan
cargo fmt/cargo clippy --all-targets -- -D warningsclean.cargo test --lib --tests --lockedgreen.GITWAY_INTEGRATION_TESTS=1 cargo test --test test_proxy_jump -- --ignoredpasses locally.GITWAY_INTEGRATION_TESTS=1 cargo bench --bench proxy_chainenforces the NFR-16 ratio without panicking.Plan: M13.7 of let-us-plan-on-bright-cosmos.md.
🤖 Generated with Claude Code